//
//  ZWLMyCell.swift
//  testSnap
//
//  Created by czh on 2016/10/11.
//  Copyright © 2016年 zwl. All rights reserved.
//

import UIKit
import SnapKit

class ZWLMyCell: UITableViewCell {
    
    fileprivate lazy var testLabel : UILabel = {
        let testLabel = UILabel()
        testLabel.font = UIFont.systemFont(ofSize: 18)
        testLabel.textColor = UIColor.black
        testLabel.text = "你好"
        return testLabel
    }()
    
    lazy var lineView : UIView = {
        let lineView = UIView()
        lineView.backgroundColor = UIColor.lightGray
        lineView.alpha = 0.5
        return lineView
    }()

    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        setupUI()
        
        setupCons()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

}

extension ZWLMyCell {
    fileprivate func setupUI() {
        
        contentView.addSubview(testLabel)
        contentView.addSubview(lineView)
    
    }
    
    fileprivate func setupCons() {
        
        testLabel.snp.makeConstraints { (make) in
            make.center.equalToSuperview()
        }
        
        lineView.snp.makeConstraints { (make) in
            make.left.right.bottom.equalToSuperview()
            make.height.equalTo(1)
        }
        
    }
}
